//**************************************************************
//檔案名稱:ASPTree13.JS
//目    的:提供GSSCM_ASPTREE13元件所需的JavaScript函數
//
// 版本變更：
// xx. YYYY/MM/DD  AUTHOR    COMMENTS
// 12. 2004/08/24	Roger Lo	新增 __trHasChild(),__trChildNodeCount(),__trGetChildNodeIDs(),__trGetChildNodeVals()
// 11. 2003/06/24 Roger Lo	修改 __trParseFileName()
// 10. 2003/05/30 Roger Lo	修改 __trGetNodeID(),__trGetTreeName()函數
//	9. 2003/02/14 Roger Lo	修改 取消Preload img,TRsetImg(),funToggleImg(),__trParseFileName(),__trSpanAll(),__trCollapseAll()
//	8. 2003/01/24 Roger Lo	修改 __trGetFullNodeID(),__trGetFullNodeValue()函數
//	7. 2002/06/17 Roger Lo	Release
//	6. 2002/03/26 Roger Lo	修改 TRsetImg()
//  5. 2002/01/31 Roger Lo  新增 __trSpanByLevel()函數, __trRecSpanDown()函數
//	4. 2002/01/03 Roger Lo	修改 funToggleDisplay(),__trGetNodeValue(),新增 __trGetFullNodeID(), __trGetFullNodeValue()函數
//	3. 2001/12/20 Roger Lo	修改 funToggleDisplay(),__trGetSpanNodeHTML(),__trGetSpanNodeHTMLByDialogWindow() 函數
//	2. 2001/12/10 Roger Lo	新增 __trReloadFolder()函數
//  1. 2001/11/22	Roger Lo	Beta 1 Release
//**************************************************************

//宣告全域變數
var moLastNode,mLastBkColor,mLastColor;
var mIMG_EM,mIMG_EP,mIMG_LM,mIMG_LP,mIMG_FolderO,mIMG_FolderC,mIMG_ETM,mIMG_ETP,mIMG_LTM,mIMG_LTP;
var mIMG_VL,mIMG_BL,mIMG_E,mIMG_L,mIMG_LT,mIMG_LF;

//函數名稱: __trToggleFolder
//功能: 展開或收摺節點
//備註:
//參數說明:
// oNode: (IMG物件)檔案夾左邊的圖示(+ or -)物件
// bForceOpen: (Boolean)是否強迫開啟
//修改:
function __trToggleFolder(oNode,bForceOpen) {		
	var sTreeName=oNode.id.substring(0,(oNode.id.indexOf('IMN_')));
	var sNodeID=oNode.id.substr(sTreeName.length+4);	
	var oImgF=document.getElementById(sTreeName+'IMF_'+sNodeID);
	var oBD=document.getElementById(sTreeName+'BD_'+sNodeID);
	if (bForceOpen==null) {
		funToggleImg(oNode,oImgF);
		funToggleDisplay(oBD);
	} else if (bForceOpen) {
		if (oBD.style.display=='none') {
			funToggleImg(oNode,oImgF);
			funToggleDisplay(oBD);
		}
	}
}


function funToggleDisplay(oDiv) {
//切換子節點的顯示狀態
//修改:
//	2002/01/03 by Roger Lo, 處理自訂節點時的節點標題
//	2001/12/20 by Roger Lo, 根據傳回值更改節點標題
	if (oDiv.innerHTML=='') {
		var sNodeID=__trGetNodeID(oDiv);
		var sTrName=__trGetTreeName(oDiv);
		var sCapID=sTrName+'A_'+sNodeID;
		var oCap=document.getElementById(sCapID);
		var sCap='';
		var oParent=oDiv.parentElement;
		oCap.innerHTML='Loading...';
		oDiv.style.cursor='wait';
		sCap=__trGetSpanNodeHTML(oDiv);
		if (sCap.indexOf('/*')>=0) {sCap=sCap.split('/*')[2];}		
		oCap.innerHTML=sCap;
		oDiv.style.display='';
		oDiv.style.cursor='default';
		oParent.innerHTML=oParent.innerHTML;
	} else if (oDiv.style.display=="none") {
   		oDiv.style.display='';
  }	else {oDiv.style.display="none" ; }
}


//函數名稱: __trGetNodeID
//功能:取得節點的ID值
//備註:
//參數說明:
// e: (span/img/div物件)節點上的標題/圖示/區塊等物件
//修改:
//2003/05/30 by Roger, 避免TreeName中含底線
function __trGetNodeID(e) {	
	var nid=e.id.substr(__trGetTreeName(e).length);
	return nid.substr(nid.indexOf('_')+1);		
}


//函數名稱: __trGetParentNodeID
//功能:取得上層節點ID值
//備註:
//參數說明:
// e: (span/img/div物件)節點上的標題/圖示/區塊等物件
//修改:
function __trGetParentNodeID(e) {
	var sNID=__trGetNodeID(e);
	var sParentID=__trGetNodeID(e.parentElement);
	var sTrName=__trGetTreeName(e);
	while (sParentID==sNID && e!=null) {
		e=__trGetParentElementByTag(e,'DIV');
		sParentID=__trGetNodeID(e);
	}	
	if (sParentID==sTrName) {sParentID=''}
	return sParentID;
}

//函數名稱: __trGetXMLNodeID
//功能:取得節點在XML資料中的路徑名稱
//備註:
//參數說明:
// e: (span/img/div物件)節點上的標題/圖示/區塊等物件
//修改:
function __trGetXMLNodeID(e) {
	var sNid=__trGetNodeID(e);
	var sRet='/node[@nid="'+sNid+'"]';
	var sPid=__trGetParentNodeID(e);
	while (sPid!='') {
		sRet='/node[@nid="'+sPid+'"]'+sRet;
		e=__trGetParentElementByTag(e,'DIV');
		sPid=__trGetParentNodeID(e);
	}
	return sRet;
}

//函數名稱: __trGetParentElementByTag
//功能:取得符合指定標籤的上層物件
//備註:
//參數說明:
// obj: 任何DHTML物件
// sTag:標籤名稱
//修改:
function __trGetParentElementByTag(obj,sTag) {
	sTag=sTag.toUpperCase();
	obj=obj.parentElement;
	while (obj.tagName!=sTag) {
		obj=obj.parentElement;
		if(obj==null) return;
	}		
	return obj
}

//函數名稱: __trGetTreeName
//功能:取得Tree的名稱
//備註:
//參數說明:
// e: Tree內的任何物件
//修改:
//1.2003/05/30 by Roger,避免TreeName含底線
function __trGetTreeName(e) {	
	while (e!=null && e.getAttribute('__trSID',1)==null) {
		e=e.parentElement;
	}
	return e.id;
}


//函數名稱: funToggleImg
//功能:切換展開與收摺的圖示
//備註:
//參數說明:
// objN:(IMG物件)檔案夾前的圖示(+ or -)
// objF:(IMG物件)檔案夾圖示
//修改:
//1. 2003/02/14 Roger Lo, 只取出純檔名比較
function funToggleImg(objN, objF) {
	//切換 Folder 的圖形
	if (objF!=null)	{
		var imgF=objF.src.toUpperCase();
		if (imgF.indexOf(__trParseFileName(mIMG_FolderO))!=-1) {objF.src=mIMG_FolderC }
		else if (imgF.indexOf(__trParseFileName(mIMG_FolderC))!=-1){objF.src=mIMG_FolderO}
	}	
	//切換 Node 的圖形
	var imgN=objN.src.toUpperCase();
	if (imgN.indexOf(__trParseFileName(mIMG_LTM))!=-1){objN.src=mIMG_LTP}
	else if (imgN.indexOf(__trParseFileName(mIMG_LTP))!=-1){objN.src=mIMG_LTM}
	else if (imgN.indexOf(__trParseFileName(mIMG_ETM))!=-1){objN.src=mIMG_ETP}
	else if (imgN.indexOf(__trParseFileName(mIMG_ETP))!=-1){objN.src=mIMG_ETM}
	else if (imgN.indexOf(__trParseFileName(mIMG_EM))!=-1){objN.src=mIMG_EP}
	else if (imgN.indexOf(__trParseFileName(mIMG_EP))!=-1) {objN.src=mIMG_EM}
	else if (imgN.indexOf(__trParseFileName(mIMG_LM))!=-1){objN.src=mIMG_LP}
	else if (imgN.indexOf(__trParseFileName(mIMG_LP))!=-1) {objN.src=mIMG_LM}
}

function __trParseFileName(sIn){
//取得純檔名的部分
//修改:
//2. 2003/06/24 Roger Lo, 忽略sIn為null的情況
//1. 2003/02/14 Roger Lo, Created		
	if (sIn) {
		if (sIn.lastIndexOf('\/')>-1) {
			return sIn.substr(sIn.lastIndexOf('\/')+1)
		} else if(sIn.lastIndexOf('\\')>-1) {
			return sIn.substr(sIn.lastIndexOf('\\')+1)
		} else { return sIn }
	}
}

//函數名稱: __trToggleFolderByCap
//功能:點選節點標題展開或收摺
//備註:
//參數說明:無
//修改:
function __trToggleFolderByCap( ){
	var e=event.srcElement
	sTr=__trGetTreeName(e);
	sID=__trGetNodeID(e);
	var oNode=document.getElementById(sTr+'IMN_'+sID);
	oNode.click();
}


//函數名稱: __trSpanFolder
//功能:展開指定的檔案夾
//備註:
//參數說明:
//	sNode:(String)節點名稱
//	sTreeName:(String,Optional)Tree的名稱
//修改:
function __trSpanFolder(sNode,sTreeName){
	if (!sTreeName) sTreeName='gssTr';
	var imnID=sTreeName+'IMN_'+ sNode;
	var objNode=document.getElementById(imnID);
	if (objNode!=null) {__trToggleFolder(objNode,true);}
	else {
		objNode=document.getElementById(sTreeName+'A_'+sNode);
		if (objNode==null) return;
	}		
	//將所有直屬上層節點也打開
	var sParentID=__trGetParentNodeID(objNode);
	while (sParentID!='') {				
		imnID=sTreeName+'IMN_'+sParentID;
		objNode=document.getElementById(imnID);		
		__trToggleFolder(objNode,true);
		sParentID=__trGetParentNodeID(objNode);
	}	
}


//函數名稱: __trReloadFolder
//功能:重新載入指定的檔案夾並打開
//備註:
//參數說明:
//	sNodeID:(String)節點名稱
//	sTreeName:(String,Optional)Tree的名稱
//修改:
//	2001/12/10 by Roger Lo,New Created
function __trReloadFolder(sNodeID,sTreeName) {
	if (!sTreeName) sTreeName='gssTr';
	var oBD=document.getElementById(sTreeName+'BD_'+sNodeID);
	var oNode=document.getElementById(sTreeName+'IMN_'+sNodeID);
	var oImgF=document.getElementById(sTreeName+'IMF_'+sNodeID);
	if (oBD!=null) {
		if (oBD.style.display=='') {
			funToggleImg(oNode,oImgF);
			oBD.style.display='none';
		}
		oBD.innerHTML='';
		__trToggleFolder(oNode,true);
	}	
}

//函數名稱: __trSpanAll
//功能:將樹狀圖完全展開
//備註:
//參數說明:
//	sTreeName:(String,Optional)Tree的名稱
//修改:
//1.2003/02/14 Roger Lo, 取純檔名比較
function __trSpanAll(sTreeName){
	if (sTreeName==null) sTreeName='gssTr';
	var t=document.getElementById(sTreeName);
	var colBD=t.all.tags("DIV") ;
	//將所有Branch的Div展現出來
	if (colBD==null) return;
	for (i=0; i<colBD.length; i++) {
		if (colBD[i].id.indexOf("BD_")!=-1) colBD[i].style.display="";
	}	
	//將所有Folder的Image變成FolderOpen; Lplus, Eplus 變成 Lminus, Eminus
	colImg=t.all.tags("IMG") ;
	if (colImg!=null) {
		for (i=0; i<colImg.length; i++) {
			s=colImg[i].src.toUpperCase();	
			if (s.indexOf(__trParseFileName(mIMG_LP))!=-1){ colImg[i].src=mIMG_LM}
			if (s.indexOf(__trParseFileName(mIMG_EP))!=-1){colImg[i].src=mIMG_EM}
			if (s.indexOf(__trParseFileName(mIMG_FolderC))!=-1){colImg[i].src=mIMG_FolderO}
			if (s.indexOf(__trParseFileName(mIMG_ETP))!=-1){colImg[i].src=mIMG_ETM}
			if (s.indexOf(__trParseFileName(mIMG_LTP))!=-1){colImg[i].src=mIMG_LTM}
		} 
	} 
}

//函數名稱: __trCollapseAll
//功能:將樹狀圖完全收摺
//備註:
//參數說明:
//	sTreeName:(String,Optional)Tree的名稱
//修改:
// 1.2003/02/14 Roger Lo,取純檔名比較
function __trCollapseAll(sTreeName){
	if (sTreeName==null) sTreeName='gssTr';
	var t=document.getElementById(sTreeName);
	var colBD=t.all.tags("DIV") ;
		
	//將所有Branch的Div隱藏出來
	if (colBD==null) return;
	for (i=0; i<colBD.length; i++) {
		if (colBD[i].id.indexOf("BD_")!=-1) colBD[i].style.display="none";
	}
	//將所有Folder的Image變成FolderClose; Lminus, Eminus 變成 Lplus, Eplus 
	colImg=t.all.tags("IMG");
	if (colImg==null) return;
	for (i=0; i<colImg.length; i++) {
		s=colImg[i].src.toUpperCase();
		if (s.indexOf(__trParseFileName(mIMG_LM))!=-1) colImg[i].src=mIMG_LP;
		else if (s.indexOf(__trParseFileName(mIMG_EM))!=-1) colImg[i].src=mIMG_EP;
		else if (s.indexOf(__trParseFileName(mIMG_FolderO))!=-1) colImg[i].src=mIMG_FolderC;
		else if (s.indexOf(__trParseFileName(mIMG_LTM))!=-1) colImg[i].src=mIMG_LTP;
		else if (s.indexOf(__trParseFileName(mIMG_ETM))!=-1) colImg[i].src=mIMG_ETP;
	} 
}

//函數名稱: TRsetImg
//功能:設定圖示
//備註:由元件呼叫
//參數說明:各圖示名稱
//修改:
//	2.2003/02/14 by Roger Lo,不使用src屬性設聽圖形路徑,避免有些IE會Hang住
//	1.2002/03/26 by Roger Lo,由src屬性設定圖形路徑,避免有使用..的方式
function TRsetImg(imgEm, imgEp, imgLm, imgLp, imgFo, imgFc, imgETm, imgETp, imgLTm, imgLTp)	{
	mIMG_EM=imgEm;
	mIMG_EP=imgEp;
	mIMG_LM=imgLm;
	mIMG_LP=imgLp;
	mIMG_FolderO=imgFo;
	mIMG_FolderC=imgFc;
	mIMG_ETM=imgETm;
	mIMG_ETP=imgETp;
	mIMG_LTM=imgLTm;
	mIMG_LTP=imgLTp;	
}

//函數名稱: __trGetTreeSID
//功能:取得Tree的Session值
//備註:
//參數說明:
//  e:Tree內的任何物件
//修改:
function __trGetTreeSID(e) {
	var oTrDiv=document.getElementById(__trGetTreeName(e));
	return oTrDiv.__trSID;
}

//函數名稱: __trGetTreeFolderOpenASP
//功能:取得展開時要執行的ASP
//備註:
//參數說明:
//  e:Tree內的任何物件
//修改:
function __trGetTreeFolderOpenASP(e) {
	var oTrDiv=document.getElementById(__trGetTreeName(e));	
	return oTrDiv.__trFolderOpanASP;
}

//函數名稱: __trGetTreeFolderOpenASP
//功能:取得子節點的HTML碼
//備註:
//參數說明:
//  oDiv:(DIV物件)子節點區塊
//修改:
//	2001/12/20 by Roger Lo, 傳回值新的標題
function __trGetSpanNodeHTML(oDiv) {	
	return __trGetSpanNodeHTMLByDialogWindow(oDiv);
}

/*
//利用XMLHTTP物件取得子節點的HTML碼
function __trGetSpanNodeHTMLByXMLHTTP(oDiv) {		
	var oTrDiv=document.getElementById(__trGetTreeName(oDiv));	
	var sSID=oTrDiv.__trSID;
	var sNodeID=__trGetNodeID(oDiv);	
	var sTmpPath=oTrDiv.__trTmpFilePath;	
	var sXML='<?xml version="1.0" encoding="Big5" ?>';
	sXML+='<GSSCM_ASPTREE13>';
	sXML+='<SID>'+sSID+'</SID>';
	sXML+='<NODE_ID>'+sNodeID+'</NODE_ID>';
	sXML+='<TMP_FILE_PATH>'+sTmpPath+'</TMP_FILE_PATH>';		
	sXML+='</GSSCM_ASPTREE13>';		
		
	var xmlHTTP=new ActiveXObject("MSXML2.XMLHTTP");	
	var sURL="PUB/ASPTREE13_X.ASP"
	xmlHTTP.open("post",sURL, false);
	xmlHTTP.send(sXML);
	var sHTML=xmlHTTP.responseText;	
	oDiv.innerHTML=sHTML;	
}
*/


//函數名稱: __trGetSpanNodeHTMLByDialogWindow
//功能:利用DialogWindow取得子節點的HTML碼
//備註:
//參數說明:
//  oDivBD:(DIV物件)子節點區塊
//傳回值:
//	節點標題
//修改:
//	2001/12/20 by Roger Lo, 傳回展開節點的標題
function __trGetSpanNodeHTMLByDialogWindow(oDivBD) {	
	var sTrName=__trGetTreeName(oDivBD);
	var sNodeId=__trGetNodeID(oDivBD);
	var sXMLNodeId=__trGetXMLNodeID(oDivBD);
	var oTrDiv=document.getElementById(sTrName);
	var oDivHD=document.getElementById(sTrName+'HD_'+sNodeId);
	if (__trGetTreeFolderOpenASP(oDivBD)!='') {sURL=__trGetTreeFolderOpenASP(oDivBD)}
	else {sURL="PUB/ASPTREE13_D.ASP"}		
	sQry='SID='+escape(oTrDiv.__trSID)+'&NODE_ID='+escape(sNodeId)+'&XNID='+escape(sXMLNodeId)+'&TMP_FILE_PATH='+escape(oTrDiv.__trTmpFilePath)+'&NODE_VALUE='+escape(oDivHD.__trNDVAL)+'&TREE_NAME='+escape(sTrName);
	var sHTML=window.showModalDialog(sURL+'?'+sQry,"WIN_ASPTREE13","dialogTop:-100px;dialogLeft:2000px;dialogHeight:100px;dialogWidth:100px;help:no;unadorned:no;status:no;resizable:yes;scroll:no");
	var sCap=sHTML.substr(0,sHTML.indexOf('\n'));
	oDivBD.innerHTML=sHTML.substring(sHTML.indexOf('\n')+1);
	return sCap;
}

//函數名稱: __trGetNodeValue
//功能:取得點選節點的節點值
//備註:
//參數說明:
//	obj:(Optional)節點的div,img,span物件
//修改:
//	2002/01/03 by Roger Lo,加入參數
function __trGetNodeValue(obj) {
	if (obj==null) {obj=event.srcElement;}
	while (obj.tagName!='DIV') {
		obj=obj.parentElement;
		if(obj==null) return;
	}
	try { return obj.__trNDVAL; }	catch(e) { return ''}
}


//函數名稱: __trNodeExists
//功能:檢查Node ID是否存在既有的節點中
//備註:
//參數說明:
// sNodeID:節點名稱
// sTrName:(Optional)Tree名稱
//修改:
function __trNodeExists(sNodeID,sTrName) {	
	if (sTrName==null) sTrName='gssTr';
	var sFullNid=sTrName+'HD_'+sNodeID;
	var oNode=document.getElementById(sFullNid);
	if (oNode!=null) {return true}
	else return false;
}

//函數名稱: __trGetFullNodeID
//功能:取得完整路徑的節點代號
//備註:
//參數說明:
// sDelimiter:(Optional)分隔符號;預設為逗號
// sTrName:(Optional)Tree名稱
//修改:
//	2003/01/24 by Roger Lo, 由事件來源往上取得完整路徑,避免node id重複的情形
//	2002/01/03 by Roger Lo, Created
function __trGetFullNodeID(sDelimiter,sTrName) {
 if (sDelimiter==null) sDelimiter=',';
 if (sTrName==null) sTrName='gssTr';
 var e=event.srcElement; //first click  
 var sPid=__trGetParentNodeID(e); //id of HD 
 e=__trGetParentElementByTag(e,'DIV'); //refer to HD 
 var sFullNid=__trGetNodeID(e);
 while (sPid!='' && e!=null) {
  //find HD
  e=e.parentElement; //refer to parent BD
  e=e.previousSibling //refer to HD  
  sPid=__trGetParentNodeID(e) //get parent id  
  sFullNid=__trGetNodeID(e)+sDelimiter+sFullNid;
 }   
 return sFullNid;
}

//函數名稱: __trGetFullNodeValue
//功能:取得完整路徑的節點值
//備註:
//參數說明:
// sDelimiter:(Optional)分隔符號;預設為逗號
// sTrName:(Optional)Tree名稱
//修改:
//	2003/01/24 by Roger Lo, 由事件來源往上取得完整路徑,避免node id重複的情形
//	2002/01/03 by Roger Lo, Created
function __trGetFullNodeValue(sDelimiter,sTrName) {
 if (sDelimiter==null) sDelimiter=',';
 if (sTrName==null) sTrName='gssTr';
 var e=event.srcElement; //first click  
 var sPid=__trGetParentNodeID(e); //id of HD 
 e=__trGetParentElementByTag(e,'DIV'); //refer to HD 
 var sFullNval=__trGetNodeValue(e);
 while (sPid!='' && e!=null) {
  //find HD
  e=e.parentElement; //refer to parent BD
  e=e.previousSibling //refer to HD  
  sPid=__trGetParentNodeID(e) //get parent id  
  sFullNval=__trGetNodeValue(e)+sDelimiter+sFullNval;
 }
 return sFullNval; 
}

//函數名稱: __trSpanByLevel
//功能:展開至指定層級
//備註:
//	必須在Tree完全load後才有效
//參數說明:
// iLevel:層級數
// sTrName:(Optional)Tree名稱
//修改:
//	2002/01/30 by Roger Lo, Created
function __trSpanByLevel(iLevel,sTrName) {
	if (iLevel<=0) return;
	if (sTrName==null) sTrName='gssTr';
	var oRoot=document.getElementById(sTrName);	
	__trRecSpanDown(oRoot,0,iLevel,sTrName);
}

//函數名稱: __trRecSpanDown
//功能:遞迴展開子節點到指定層級
//備註:
//	必須在Tree完全load後才有效
//參數說明:
//	oNode:節點本體BD_區塊的DIV物件
//	iCurDepth:目前層級數
//	iLastLevel:最後層級數
// sTrName:(Optional)Tree名稱
//修改:
//	2002/01/30 by Roger Lo, Created
function __trRecSpanDown(oNode,iCurDepth,iLastLevel,sTrName) {
	if (iCurDepth>=iLastLevel) return;
	if (sTrName==null) sTrName='gssTr';
	var sPrefix=sTrName+'BD_';
	var colNode=oNode.children.tags('DIV');	
	for (var i=0;i<colNode.length;i++) {
		var sNid=colNode[i].id;
		if (sNid.indexOf(sPrefix)==0) {
			sNid=sNid.substr(sPrefix.length);
			__trSpanFolder(sNid,sTrName);
			__trRecSpanDown(colNode[i],iCurDepth+1,iLastLevel,sTrName);
		}		
	}		
}



//函數名稱: __trHasChild
//功能:是否有子節點(true/false)
//備註:
//參數說明:
// e: (span/img/div物件)節點上的標題/圖示/區塊等物件
//	2003/08/24 by Roger Lo, Created
function __trHasChild(e) {
	var oBD=document.getElementById(__trGetTreeName(e)+'BD_'+__trGetNodeID(e));
	return ((oBD)?true:false)
}

//函數名稱: __trChildNodeCount
//功能:子節點數
//備註:
//參數說明:
// e: (span/img/div物件)節點上的標題/圖示/區塊等物件
//	2003/08/24 by Roger Lo, Created
function __trChildNodeCount(e) {
	var ary= __trGetChildNodeIDs(e);
	return ary.length;
}


//函數名稱: __trGetChildNodeIDs
//功能:取得子節點代號(Array)
//備註:
//參數說明:
// e: (span/img/div物件)節點上的標題/圖示/區塊等物件
//	2003/08/24 by Roger Lo, Created
function __trGetChildNodeIDs(e) {
	var aryNodes=new Array();
	var treename=__trGetTreeName(e);
	var oBD=document.getElementById(treename+'BD_'+__trGetNodeID(e));
	if (oBD) {
		var colNd=oBD.children;
		var prefix=treename+'HD_';		
		for (var i=0;i<colNd.length;i++){
			var nid=colNd[i].id;
			if(nid.substr(0,prefix.length)==prefix) {
				aryNodes.push(nid.substr(prefix.length));				
			}
		}
	}
	return aryNodes;	
}


//函數名稱: __trGetChildNodeVals
//功能:取得子節點值(Array)
//備註:
//參數說明:
// e: (span/img/div物件)節點上的標題/圖示/區塊等物件
//	2003/08/24 by Roger Lo, Created
function __trGetChildNodeVals(e) {
	var aryNodes=new Array();
	var treename=__trGetTreeName(e);
	var oBD=document.getElementById(treename+'BD_'+__trGetNodeID(e));
	if (oBD) {
		var colNd=oBD.children;
		var prefix=treename+'HD_';		
		for (var i=0;i<colNd.length;i++){
			var nid=colNd[i].id;			
			if(nid.substr(0,prefix.length)==prefix) {
				aryNodes.push(colNd[i].__trNDVAL);				
			}
		}
	}
	return aryNodes;	
}